<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.jd.ty.pojo" >
	<class name="Role" table="ROLE" schema="TYMS">
	    <id name="roleId" type="java.lang.Long">
            <column name="ROLE_ID" precision="10" scale="0" />
            <generator class="identity" >
            </generator>
	    </id>
		<property name="roleName" type="java.lang.String">
		    <column name="ROLE_NAME" length="20" not-null="true"  />
		</property>
		<property name="admin">
		    <column name="IS_ADMIN" sql-type="BOOLEAN"  not-null="true"  default="0"/>
		</property>
		<bag name="permissions" fetch="select" cascade="all" lazy="false" >
			<key column="ROLE_ID"/>
			<one-to-many class="com.jd.ty.pojo.Permission"/>
		</bag>

	</class>
</hibernate-mapping>
